<?php 
include '../inc/reuse/dbconfig.php';
$sql = "SELECT * FROM contacts WHERE contacts_active = 1 " ;
$rsd = mysql_query($sql);
$number =mysql_num_rows($rsd);
if($number >  0)
{

	while($row = mysql_fetch_array($rsd)){
		$date = $row['contacts_date_time'];
		$date = substr($date, 6,2)." ".date("M", mktime(0, 0, 0, substr($date, 4,2), 1))." ".substr($date, 0,4).", ".substr($date, 8,2).":".substr($date, 10,2);
		echo "<li><a href=\"contacts_view.php?contacts_id=".$row['contacts_id']."\">".$row['contacts_title']."</a><span> ".$row['contacts_from_sender']." | $date</span><img src=\"images/template/icon-new.gif\" /></li>";
	}
}else echo "<li>ไม่มีข้อมูลติดต่อ</li>"

?>
